// @ts-nocheck
import * as VTable from '../../src/index';
import { createDiv } from '../dom';
global.__VERSION__ = 'none';
describe('listTable-icon init test', () => {
  const containerDom: HTMLElement = createDiv();
  containerDom.style.position = 'relative';
  containerDom.style.width = '1000px';
  containerDom.style.height = '800px';

  // register icon
  VTable.register.clearAll?.();
  VTable.register.icon('sort_normal', {
    type: 'svg',
    svg: `<svg t="1669210412838" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5700" width="200" height="200"><path d="M420.559974 72.98601l-54.855 0 0 774.336c-52.455014-69.163008-121.619046-123.762995-201.120051-157.052006l0 61.968c85.838029 41.401958 156.537958 111.337984 201.120051 198.221005l0 0.208 54.855 0 0-13.047c0.005018-0.00297 0.010035-0.005018 0.01495-0.007987-0.005018-0.010035-0.010035-0.019968-0.01495-0.030003L420.559974 72.986zM658.264986 73.385984l0-0.4L603.41 72.985984l0 877.68 54.855 0L658.265 176.524c52.457984 69.178982 121.632051 123.790029 201.149952 157.078016l0-61.961C773.560013 230.238003 702.853018 160.287027 658.264986 73.385984z" p-id="5701"></path></svg>`,
    width: 20, //其实指定的是svg图片绘制多大，实际占位是box，margin也是相对阴影范围指定的
    height: 20,
    funcType: VTable.TYPES.IconFuncTypeEnum.sort,
    name: 'sort_normal',
    positionType: VTable.TYPES.IconPosition.inlineFront,
    marginLeft: 0,
    marginRight: 0,
    hover: {
      width: 24,
      height: 24,
      bgColor: 'rgba(22,44,66,0.5)'
    },
    cursor: 'pointer'
  });
  VTable.register.icon('filter', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">
    <path d="M1.29609 1C0.745635 1 0.444871 1.64195 0.797169 
    2.06491L4.64953 6.68988V9.81861C4.64953 9.89573 4.69727 
    9.9648 4.76942 9.99205L7.11236 10.877C7.27164 10.9372 7.4419 10.8195 
    7.4419 10.6492V6.68988L11.2239 2.06012C11.5703 1.63606 11.2685 1 10.721 1H1.29609Z" 
    stroke="#141414" stroke-opacity="0.65" stroke-width="1.18463" stroke-linejoin="round"/>
    </svg>`,
    // 下面的url暂时不支持
    // svg: 'https://gw.alipayobjects.com/zos/bmw-prod/f44eb1f5-7cea-45df-875e-76e825a6e0ab.svg',
    width: 20,
    height: 20,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'filter', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.absoluteRight, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 10, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'mouseenter_cell', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    // background:{??? 待定
    //   shape: 'rect'|'circle',
    //   width: 30,
    //   height: 30,
    //   radius:4,
    //   color: 'rgba(22,44,66,0.5)',
    // },
    hover: {
      // 热区大小
      width: 26,
      height: 26,
      bgColor: 'rgba(22,44,66,0.5)'
    },
    hoverSvg: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
    <path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 
    5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 
    .60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="#141414" fill-opacity="0.65"/>
    </svg>`,
    tooltip: {
      style: { arrowMark: false },
      // 气泡框，按钮的的解释信息
      title: '过滤',
      placement: VTable.TYPES.Placement.right
    }
  });
  VTable.register.icon('more', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 3 13" fill="none">
    <path fill-rule="evenodd" clip-rule="evenodd" 
    d="M0 0L2.4 1.04907e-07L2.4 2.13333L-9.3251e-08 2.13333L0 
    0ZM-2.33127e-07 5.33333L2.4 5.33333L2.4 7.46667L-3.26378e-07 
    7.46667L-2.33127e-07 5.33333ZM-4.66255e-07 10.6667L2.4 10.6667L2.4 
    12.8L-5.59506e-07 12.8L-4.66255e-07 10.6667Z" fill="#141414" fill-opacity="0.65"/>
    </svg>`,
    width: 16,
    height: 16,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'more', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.right, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 10, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'always', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    cursor: 'pointer',
    hover: {
      // 热区大小
      width: 22,
      height: 22,
      bgColor: 'rgba(22,44,66,0.5)'
    },
    hoverSvg: `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 3 13" fill="none">
      <path fill-rule="evenodd" clip-rule="evenodd" 
      d="M0 0L2.4 1.04907e-07L2.4 2.13333L-9.3251e-08 2.13333L0 0ZM-2.33127e-07 
      5.33333L2.4 5.33333L2.4 7.46667L-3.26378e-07 7.46667L-2.33127e-07 
      5.33333ZM-4.66255e-07 10.6667L2.4 10.6667L2.4 12.8L-5.59506e-07 
      12.8L-4.66255e-07 10.6667Z" fill="#1FF414" fill-opacity="0.65"/>
      </svg>`,
    tooltip: {
      // 气泡框，按钮的的解释信息
      title: '更多操作',
      style: { bgColor: 'black', arrowMark: true, color: 'white' }
    }
  });
  VTable.register.icon('phone', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg t="1669209236106" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2641" width="200" height="200"><path d="M687.104 113.02912h19.12832c15.11424 0 27.38176 12.26752 27.38176 27.38176v193.65888h-73.89184V140.41088c0-15.11424 12.26752-27.38176 27.38176-27.38176z" fill="#D4D4FF" p-id="2642"></path><path d="M744.26368 344.71936h-95.17056V149.97504c0-26.23488 21.34016-47.57504 47.57504-47.57504s47.57504 21.34016 47.57504 47.57504v32.256c0 5.87776-4.77184 10.62912-10.62912 10.62912-5.87776 0-10.62912-4.77184-10.62912-10.62912V149.97504c0-14.49984-11.79648-26.29632-26.29632-26.29632s-26.29632 11.79648-26.29632 26.29632v173.4656h52.61312v-72.0896c0-5.87776 4.77184-10.62912 10.62912-10.62912 5.87776 0 10.62912 4.77184 10.62912 10.62912v93.36832z" p-id="2643"></path><path d="M690.64704 897.57696l-13.59872 1.90464a1185.759232 1185.759232 0 0 1-329.1136 0l-14.5408-2.048c-57.36448-8.04864-102.5024-53.06368-110.6944-110.40768a1367.463936 1367.463936 0 0 1 0-386.82624c8.192-57.344 53.32992-102.35904 110.6944-110.40768l14.5408-2.048a1185.759232 1185.759232 0 0 1 329.1136 0l13.59872 1.90464c57.81504 8.11008 103.13728 53.73952 110.85824 111.616l1.536 11.59168a1367.650304 1367.650304 0 0 1 0 361.49248l-1.536 11.59168c-7.72096 57.89696-53.0432 103.5264-110.85824 111.63648z" fill="#D4D4FF" p-id="2644"></path><path d="M690.64704 897.57696c57.81504-8.11008 103.13728-53.73952 110.85824-111.616l1.536-11.59168a1367.650304 1367.650304 0 0 0 0-361.49248l-1.536-11.59168c-7.72096-57.856-53.0432-103.50592-110.85824-111.616l-13.59872-1.90464a1191.264256 1191.264256 0 0 0-62.01344-7.02464c-20.70528 1.80224-41.39008 4.13696-62.01344 7.02464l-14.5408 2.048c-49.152 6.90176-89.31328 40.93952-104.96 86.6304 62.58688-3.9936 125.7472-3.23584 188.1088 2.29376l56.9344 5.05856c10.09664 0.90112 18.00192 5.9392 19.3536 12.34944l7.41376 35.24608c10.62912 50.46272 10.62912 101.62176 0 152.08448l-7.41376 35.24608c-1.35168 6.38976-9.25696 11.44832-19.3536 12.34944l-56.9344 5.05856c-68.608 6.08256-138.15808 6.3488-206.86848 0.9216 1.59744 50.15552 5.89824 100.2496 13.02528 150.03648 8.192 57.344 53.32992 102.35904 110.6944 110.40768l14.5408 2.048c20.62336 2.88768 41.28768 5.2224 62.01344 7.02464 20.70528-1.80224 41.39008-4.13696 62.01344-7.02464l13.59872-1.96608z" fill="#EFEDFF" p-id="2645"></path><path d="M512.49152 921.6c-55.48032 0-110.94016-3.87072-166.03136-11.59168l-14.56128-2.048c-61.68576-8.64256-110.94016-57.7536-119.74656-119.43936-0.83968-5.81632 3.21536-11.20256 9.03168-12.04224 5.81632-0.83968 11.20256 3.21536 12.04224 9.03168 7.4752 52.34688 49.27488 94.02368 101.64224 101.376l14.56128 2.048c108.21632 15.1552 217.94816 15.17568 326.16448 0l13.59872-1.90464c52.87936-7.41376 94.74048-49.5616 101.7856-102.48192l1.536-11.59168a1356.929024 1356.929024 0 0 0 0-358.68672l-1.536-11.59168c-7.04512-52.92032-48.90624-95.06816-101.7856-102.48192l-13.59872-1.90464a1174.829056 1174.829056 0 0 0-326.16448 0l-14.5408 2.048c-52.36736 7.33184-94.16704 49.02912-101.64224 101.376a1359.763456 1359.763456 0 0 0-11.0592 275.5584c0.36864 5.85728-4.096 10.91584-9.95328 11.264-5.87776 0.4096-10.91584-4.096-11.264-9.97376-5.75488-93.24544-1.98656-187.41248 11.22304-279.87968 8.8064-61.66528 58.04032-110.7968 119.74656-119.43936l14.5408-2.048c110.1824-15.44192 221.9008-15.44192 332.06272 0l13.59872 1.90464c62.30016 8.72448 111.616 58.38848 119.93088 120.7296l1.536 11.59168a1378.52928 1378.52928 0 0 1 0 364.31872l-1.536 11.59168c-8.31488 62.3616-57.63072 112.00512-119.93088 120.7296l-13.59872 1.90464c-55.11168 7.76192-110.592 11.63264-166.05184 11.63264z" p-id="2646"></path><path d="M678.56384 631.02976l-56.9344 5.05856a1241.165824 1241.165824 0 0 1-218.624 0l-57.09824-5.07904c-10.01472-0.88064-17.89952-5.85728-19.33312-12.20608l-6.77888-30.02368c-12.16512-53.9648-12.16512-108.76928 0-162.73408l6.77888-30.02368c1.4336-6.3488 9.3184-11.32544 19.33312-12.20608l57.09824-5.07904c72.51968-6.43072 146.10432-6.43072 218.624 0l56.9344 5.05856c10.09664 0.90112 18.00192 5.9392 19.3536 12.34944l7.41376 35.24608c10.62912 50.46272 10.62912 101.62176 0 152.08448l-7.41376 35.24608c-1.35168 6.36928-9.25696 11.42784-19.3536 12.30848z" fill="#2ED0FC" p-id="2647"></path><path d="M427.78624 400.22016a1369.726976 1369.726976 0 0 0-13.02528 236.78976c68.7104 5.4272 138.26048 5.18144 206.86848-0.9216l56.9344-5.05856c10.09664-0.90112 18.00192-5.9392 19.3536-12.34944l7.41376-35.24608c10.62912-50.46272 10.62912-101.62176 0-152.08448l-7.41376-35.24608c-1.35168-6.38976-9.25696-11.44832-19.3536-12.34944l-56.9344-5.05856c-62.3616-5.5296-125.52192-6.28736-188.1088-2.29376a131.62496 131.62496 0 0 0-5.7344 23.81824z" fill="#7CE3FF" p-id="2648"></path><path d="M512.32768 651.55072c-36.84352 0-73.66656-1.61792-110.24384-4.87424l-57.09824-5.05856c-14.7456-1.31072-26.29632-9.54368-28.75392-20.45952l-6.77888-30.02368c-12.53376-55.54176-12.53376-111.88224 0-167.424l6.77888-30.02368c2.4576-10.93632 14.0288-19.1488 28.75392-20.45952l57.09824-5.07904c73.15456-6.49216 147.3536-6.49216 220.50816 0l56.9344 5.05856c14.90944 1.3312 26.50112 9.66656 28.81536 20.74624l7.41376 35.2256c10.91584 51.9168 10.91584 104.5504 0 156.4672l-7.41376 35.24608c-2.33472 11.07968-13.90592 19.41504-28.81536 20.74624l-0.94208-10.58816 0.94208 10.58816-56.9344 5.05856a1252.864 1252.864 0 0 1-110.26432 4.85376z m0-266.99776c-36.20864 0-72.41728 1.59744-108.35968 4.79232l-57.09824 5.07904c-6.36928 0.57344-9.54368 3.21536-9.91232 4.05504l-6.73792 29.92128c-11.81696 52.44928-11.81696 105.61536 0 158.06464l6.77888 30.02368c0.34816 0.73728 3.52256 3.3792 9.89184 3.95264l57.09824 5.05856a1227.69408 1227.69408 0 0 0 216.73984 0l56.9344-5.05856c6.36928-0.57344 9.54368-3.21536 9.91232-4.05504l7.3728-35.10272c10.30144-49.00864 10.30144-98.69312 0-147.70176l-7.41376-35.2256c-0.34816-0.7168-3.52256-3.3792-9.89184-3.93216l-56.9344-5.05856a1217.800192 1217.800192 0 0 0-108.38016-4.8128z" p-id="2649"></path><path d="M382.48448 759.6032m-60.74368 0a60.74368 60.74368 0 1 0 121.48736 0 60.74368 60.74368 0 1 0-121.48736 0Z" fill="#FFFFFF" p-id="2650"></path><path d="M382.48448 830.976c-39.36256 0-71.3728-32.01024-71.3728-71.3728s32.01024-71.3728 71.3728-71.3728 71.3728 32.01024 71.3728 71.3728-32.01024 71.3728-71.3728 71.3728z m0-121.46688c-27.62752 0-50.09408 22.46656-50.09408 50.09408s22.46656 50.09408 50.09408 50.09408 50.09408-22.46656 50.09408-50.09408-22.46656-50.09408-50.09408-50.09408z" p-id="2651"></path><path d="M700.8256 720.67072h-191.16032c-5.87776 0-10.62912-4.77184-10.62912-10.62912s4.77184-10.62912 10.62912-10.62912h191.16032c5.87776 0 10.62912 4.77184 10.62912 10.62912s-4.75136 10.62912-10.62912 10.62912zM700.8256 770.2528h-191.16032c-5.87776 0-10.62912-4.77184-10.62912-10.62912s4.77184-10.62912 10.62912-10.62912h191.16032c5.87776 0 10.62912 4.77184 10.62912 10.62912s-4.75136 10.62912-10.62912 10.62912zM599.40864 819.83488h-89.72288c-5.87776 0-10.62912-4.77184-10.62912-10.62912s4.77184-10.62912 10.62912-10.62912h89.72288c5.87776 0 10.62912 4.77184 10.62912 10.62912s-4.75136 10.62912-10.62912 10.62912z" fill="#4C5699" p-id="2652"></path><path d="M334.60224 522.01472a47.88224 33.87392 0 1 0 95.76448 0 47.88224 33.87392 0 1 0-95.76448 0Z" fill="#FF8E9E" p-id="2653"></path><path d="M567.76704 523.73504c0 29.2864-23.38816 18.7392-53.02272 17.67424-26.95168-0.98304-53.02272 11.61216-53.02272-17.67424s23.73632-53.02272 53.02272-53.02272 53.02272 23.73632 53.02272 53.02272z" fill="#4C5699" p-id="2654"></path><path d="M548.53632 554.76224c-5.26336 0-10.93632-0.6144-16.91648-1.26976-5.55008-0.6144-11.264-1.2288-17.22368-1.45408-6.2464-0.22528-12.63616 0.36864-18.80064 0.96256-13.74208 1.29024-26.7264 2.51904-35.96288-5.89824-5.71392-5.20192-8.4992-12.86144-8.4992-23.36768 0-35.10272 28.54912-63.65184 63.65184-63.65184s63.65184 28.54912 63.65184 63.65184c0 11.07968-2.8672 19.0464-8.78592 24.35072-5.81632 5.18144-12.96384 6.67648-21.11488 6.67648z m-36.90496-24.064c1.16736 0 2.33472 0.02048 3.52256 0.06144 6.73792 0.24576 13.12768 0.94208 18.78016 1.55648 8.04864 0.88064 19.06688 2.08896 21.504-0.1024 0.79872-0.7168 1.72032-3.35872 1.72032-8.4992 0-23.36768-19.00544-42.37312-42.37312-42.37312-23.36768 0-42.37312 19.00544-42.37312 42.37312 0 4.58752 0.83968 6.98368 1.55648 7.61856 2.27328 2.06848 12.30848 1.1264 19.64032 0.45056 5.48864-0.512 11.63264-1.08544 18.0224-1.08544z" p-id="2655"></path><path d="M600.82176 522.01472a47.88224 33.87392 0 1 0 95.76448 0 47.88224 33.87392 0 1 0-95.76448 0Z" fill="#FFB5C0" p-id="2656"></path><path d="M651.4688 493.19936c-3.03104 0-6.06208-1.29024-8.15104-3.80928-7.02464-8.37632-14.31552-12.65664-21.68832-12.6976h-0.1024c-13.08672 0-24.00256 12.5952-24.10496 12.71808-3.80928 4.44416-10.50624 5.0176-14.97088 1.2288-4.46464-3.7888-5.05856-10.4448-1.31072-14.92992 0.69632-0.8192 17.26464-20.29568 40.38656-20.29568 13.98784 0 26.80832 6.84032 38.0928 20.29568a10.647552 10.647552 0 0 1-1.3312 14.99136c-1.96608 1.67936-4.4032 2.49856-6.81984 2.49856zM440.81152 493.19936c-3.03104 0-6.06208-1.29024-8.15104-3.80928-7.02464-8.37632-14.31552-12.65664-21.68832-12.6976h-0.1024c-13.08672 0-24.00256 12.5952-24.12544 12.71808-3.80928 4.44416-10.50624 5.0176-14.97088 1.2288-4.46464-3.7888-5.05856-10.4448-1.31072-14.92992 0.69632-0.8192 17.26464-20.29568 40.38656-20.29568 13.98784 0 26.80832 6.84032 38.0928 20.29568a10.647552 10.647552 0 0 1-1.3312 14.99136 10.42432 10.42432 0 0 1-6.79936 2.49856z" p-id="2657"></path></svg>`,
    width: 26,
    height: 26,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'phone', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.left, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 0, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'always', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    hover: {
      // 热区大小
      width: 26,
      height: 26,
      bgColor: 'rgba(22,44,66,0.2)'
    },
    tooltip: {
      // 气泡框，按钮的的解释信息
      title: '打电话',
      placement: VTable.TYPES.Placement.left
    }
  });
  VTable.register.icon('book', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg t="1669210190896" class="icon" viewBox="0 0 1427 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4793" width="200" height="200"><path d="M1351.064977 123.555737h-107.862689V92.969424l-36.660345-14.396103C1199.192582 75.698424 1024.753324 7.932987 872.167608 7.932987c-71.440118 0-128.592212 14.720339-170.786193 43.880012-42.193982-29.159673-99.302844-43.880012-170.764578-43.880012-152.585716 0-327.024974 67.765437-334.374335 70.640334l-36.638729 14.396103v30.586313H54.291745A43.318002 43.318002 0 0 0 10.973743 166.873739v797.81643c0 23.928657 19.389345 43.318002 43.318002 43.318001h1296.773232a43.318002 43.318002 0 0 0 43.318002-43.318001V166.873739a43.318002 43.318002 0 0 0-43.318002-43.318002z m-165.620024 8.776003v633.169114c-89.446053-30.629545-327.003358-100.03778-455.184871-25.203987V102.566825c36.141566-26.998096 87.025087-36.898118 141.907526-36.898118 143.420629 0 313.277345 66.663033 313.277345 66.663033zM1120.035635 804.971249H739.295474c74.293399-70.467408 258.243596-36.595497 380.740161 0zM530.616837 65.668707c54.860823 0 105.765959 9.921638 141.88591 36.898118v637.730042c-128.181512-74.790562-365.695585-5.425558-455.163254 25.203987V132.33174s169.856715-66.663033 313.277344-66.663033z m132.850518 739.302542H282.662347c122.453333-36.638729 306.489993-70.575487 380.805008 0z m644.27962 116.400918H97.609746V210.170125h61.994027v652.536844H1243.202288V210.170125h64.544687v711.202042z" p-id="4794"></path></svg>`,
    width: 22,
    height: 22,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'book', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.inlineEnd, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 2, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'always', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    hover: {
      // 热区大小
      width: 22,
      height: 22,
      bgColor: 'rgba(22,44,66,0.2)'
    },
    tooltip: {
      title: '书籍',
      placement: VTable.TYPES.Placement.left
    }
  });
  VTable.register.icon('man', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg t="1669210780620" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10124" width="200" height="200"><path d="M512 88m-88 0a88 88 0 1 0 176 0 88 88 0 1 0-176 0Z" p-id="10125"></path><path d="M744.9 619.6c-21.3 5.7-43.3-6.9-49-28.3l-64.1-239c-1.2-4.5-7.9-3.6-7.9 1V1008c0 8.8-7.2 16-16 16h-64c-8.8 0-16-7.2-16-16V640c0-8.8-7.2-16-16-16s-16 7.2-16 16v368c0 8.8-7.2 16-16 16h-64c-8.8 0-16-7.2-16-16V353.3c0-4.7-6.7-5.6-7.9-1l-64.1 239c-5.7 21.3-27.7 34-49 28.3-21.3-5.7-34-27.6-28.3-49l69.5-260C339 240.7 402.4 192 474.8 192h74.3c72.5 0 135.9 48.7 154.6 118.7l69.5 260c5.7 21.3-6.9 43.2-28.3 48.9z" p-id="10126"></path></svg>`,
    width: 22,
    height: 22,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'man', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.inlineFront, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 0, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'always', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    hover: {
      // 热区大小
      width: 22,
      height: 22,
      bgColor: 'rgba(22,44,66,0.2)'
    },
    tooltip: {
      // 气泡框，按钮的的解释信息
      title: '男生'
    }
  });
  VTable.register.icon('woman', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg t="1669210764476" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9160" width="200" height="200"><path d="M512.5 214c39.6 0 71.7-32.1 71.7-71.7s-32.1-71.7-71.7-71.7-71.7 32.1-71.7 71.7 32.1 71.7 71.7 71.7zM501.9 668.7v250.8c0 45.1-67.6 45.1-67.6 0V668.7h-89.6l95.9-332.6h-15.1l-56.5 190c-13.4 41.4-70.3 24.4-57.3-20l62.7-206.4c6.7-23.5 36.5-65.3 88-65.3H561c51.1 0 81 42.1 88.7 65.3l62.7 206.2c12.5 44.3-43.9 62.7-57.3 19.5l-56.4-189.3h-16.3l96.9 332.6h-90v251.2c0 44.8-67.3 44.6-67.3 0V668.7h-20.1z" p-id="9161"></path></svg>`,
    width: 22,
    height: 22,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'woman', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.inlineFront, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 0, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'always', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    hover: {
      // 热区大小
      width: 22,
      height: 22,
      bgColor: 'rgba(22,44,66,0.2)'
    },
    tooltip: {
      // 气泡框，按钮的的解释信息
      title: '女生'
    }
  });
  VTable.register.icon('dropDownCustom', {
    type: 'svg', //指定svg格式图标，其他还支持path，image，font
    svg: `<svg t="1669211210585" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2951" width="200" height="200"><path d="M836.899 399.237l-218.01 335.037c-47.506 73.007-166.272 73.007-213.778 0l-218.01-335.037C139.595 326.23 198.977 234.97 293.99 234.97h436.02c95.013 0 154.395 91.26 106.889 164.267z" fill="#FF7B15" p-id="2952"></path></svg>`,
    width: 22,
    height: 22,
    // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
    name: 'dropDownCustom', //定义图标的名称，在内部会作为缓存的key值
    positionType: VTable.TYPES.IconPosition.absoluteRight, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
    marginLeft: 0, // 左侧内容间隔 在特定位置position中起作用
    marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
    visibleTime: 'always', // 显示时机， 'always' | 'mouseover_cell' | 'click_cell'
    hover: {
      // 热区大小
      width: 32,
      height: 32,
      bgColor: 'rgba(22,44,66,0.2)'
    },
    tooltip: {
      // 气泡框，按钮的的解释信息
      title: '下拉菜单'
    }
  });
  const personsDataSource = [
    {
      progress: 100,
      id: 1,
      name: 'a'
    },
    {
      progress: 80,
      id: 2,
      name: 'b'
    },
    {
      progress: 1,
      id: 3,
      name: 'c'
    },
    {
      progress: 55,
      id: 4,
      name: 'd'
    },
    {
      progress: 28,
      id: 5,
      name: 'e'
    },
    {
      progress: 100,
      id: 11,
      name: 'a'
    },
    {
      progress: 80,
      id: 22,
      name: 'b'
    },
    {
      progress: 1,
      id: 33,
      name: 'c'
    },
    {
      progress: 55,
      id: 44,
      name: 'd'
    },
    {
      progress: 28,
      id: 55,
      name: 'e'
    },
    {
      progress: 100,
      id: 111,
      name: 'a'
    },
    {
      progress: 80,
      id: 222,
      name: 'b'
    },
    {
      progress: 1,
      id: 333,
      name: 'c'
    },
    {
      progress: 55,
      id: 444,
      name: 'd'
    },
    {
      progress: 28,
      id: 555,
      name: 'e'
    }
  ];
  const option: VTable.ListTableConstructorOptions = {
    columns: [
      {
        field: 'progress',
        fieldFormat(rec) {
          return `已完成${rec.progress}%`;
        },
        title: 'progress',
        description: '这是一个标题的详细描述',
        width: 150,
        headerIcon: [
          'more',
          'phone',
          'book',
          {
            type: 'svg', //指定svg格式图标，其他还支持path，image，font
            svg: `<svg t="1669305300496" class="icon" viewBox="0 0 1034 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3506" width="200" height="200"><path d="M1033.244444 652.8c0 6.4 0 19.2 0 32s-6.4 25.6-12.8 38.4c-6.4 12.8-12.8 25.6-19.2 32-6.4 12.8-12.8 19.2-25.6 19.2-6.4 6.4-19.2 6.4-25.6 6.4-6.4 0-12.8 0-19.2-6.4-6.4 0-19.2-6.4-25.6-6.4-12.8 0-19.2 0-32 0s-25.6 6.4-32 6.4c-12.8 6.4-19.2 12.8-32 19.2-19.2 19.2-25.6 38.4-32 64 0 25.6 0 44.8 12.8 64 6.4 12.8 6.4 32-6.4 44.8-6.4 6.4-12.8 12.8-19.2 19.2-6.4 6.4-19.2 12.8-32 19.2-12.8 6.4-25.6 6.4-38.4 12.8-12.8 0-25.6 6.4-32 6.4-6.4 0-12.8 0-19.2-6.4-6.4-6.4-12.8-12.8-12.8-19.2l0 0c-6.4-25.6-19.2-44.8-38.4-57.6-19.2-19.2-44.8-25.6-70.4-25.6S476.444444 921.6 450.844444 940.8c-19.2 19.2-32 38.4-44.8 57.6-6.4 6.4-6.4 12.8-19.2 19.2C386.844444 1024 380.444444 1024 367.644444 1024c-12.8 0-19.2 0-32-6.4-12.8-6.4-25.6-6.4-38.4-12.8-12.8-6.4-25.6-12.8-32-19.2-12.8-6.4-19.2-12.8-25.6-19.2-6.4-6.4-6.4-12.8-6.4-19.2 0-6.4 0-19.2 6.4-32 6.4-19.2 12.8-38.4 6.4-57.6 0-19.2-12.8-44.8-25.6-57.6S194.844444 780.8 182.044444 780.8c-12.8-6.4-25.6-6.4-44.8-6.4-12.8 0-32 6.4-44.8 6.4s-19.2 0-32 0c-6.4 0-12.8-12.8-25.6-19.2-6.4-12.8-12.8-25.6-19.2-38.4C9.244444 710.4 2.844444 697.6 2.844444 684.8s-6.4-25.6 0-32c0-19.2 6.4-25.6 19.2-32C54.044444 614.4 73.244444 595.2 92.444444 576s25.6-44.8 25.6-64c0-25.6-6.4-51.2-25.6-64C73.244444 422.4 54.044444 409.6 34.844444 403.2 28.444444 396.8 22.044444 390.4 15.644444 384 9.244444 377.6 9.244444 364.8 9.244444 358.4c0-6.4 0-19.2 6.4-32 0-12.8 6.4-25.6 12.8-32 6.4-12.8 12.8-19.2 19.2-32 0-6.4 6.4-12.8 12.8-19.2C66.844444 236.8 73.244444 236.8 79.644444 236.8c6.4 0 12.8 0 19.2 6.4 19.2 6.4 44.8 12.8 64 6.4 25.6-6.4 44.8-12.8 64-32 6.4-6.4 12.8-19.2 19.2-32 6.4-12.8 6.4-25.6 6.4-38.4s0-25.6 0-32c0-12.8 0-19.2 0-19.2 0-6.4 0-6.4-6.4-12.8 0-6.4 0-12.8 0-12.8 6.4-19.2 19.2-25.6 25.6-38.4 12.8-6.4 25.6-12.8 38.4-19.2C322.844444 6.4 335.644444 6.4 348.444444 0c12.8 0 25.6 0 32 0C386.844444 0 393.244444 0 399.644444 6.4c6.4 6.4 6.4 12.8 12.8 19.2C418.844444 51.2 431.644444 64 450.844444 83.2c19.2 12.8 38.4 25.6 64 25.6 25.6 0 51.2-6.4 70.4-19.2 19.2-12.8 32-32 44.8-57.6 0-6.4 6.4-12.8 12.8-19.2C649.244444 0 655.644444 0 662.044444 0c12.8 0 19.2 0 32 6.4 12.8 0 25.6 6.4 38.4 12.8 12.8 6.4 25.6 12.8 32 19.2C770.844444 44.8 777.244444 51.2 783.644444 64c6.4 6.4 6.4 12.8 6.4 19.2 0 6.4 0 12.8-6.4 12.8-6.4 19.2-12.8 44.8-6.4 64 6.4 25.6 12.8 44.8 32 64s38.4 25.6 64 32c25.6 0 51.2 0 70.4-12.8 6.4-6.4 12.8-6.4 19.2-6.4 6.4 0 12.8 6.4 19.2 12.8 12.8 12.8 19.2 25.6 32 44.8 6.4 19.2 12.8 44.8 19.2 64 0 12.8 0 19.2-6.4 32-6.4 6.4-12.8 12.8-19.2 12.8C982.044444 409.6 962.844444 422.4 950.044444 448c-19.2 19.2-25.6 44.8-25.6 70.4 0 25.6 6.4 44.8 19.2 64 12.8 19.2 32 32 51.2 38.4 6.4 0 6.4 6.4 12.8 6.4C1020.444444 633.6 1026.844444 640 1033.244444 652.8L1033.244444 652.8 1033.244444 652.8 1033.244444 652.8zM521.244444 748.8c32 0 64-6.4 96-19.2 32-12.8 57.6-32 76.8-51.2 19.2-19.2 38.4-44.8 51.2-76.8C751.644444 576 758.044444 544 758.044444 512s-6.4-64-19.2-96C726.044444 384 706.844444 364.8 687.644444 339.2 668.444444 320 642.844444 300.8 610.844444 288 585.244444 275.2 553.244444 268.8 521.244444 268.8s-64 6.4-96 19.2C399.644444 300.8 374.044444 320 348.444444 339.2 329.244444 364.8 310.044444 390.4 297.244444 416 290.844444 448 284.444444 480 284.444444 512s6.4 64 19.2 96c12.8 32 32 57.6 51.2 76.8 19.2 19.2 44.8 38.4 76.8 51.2C457.244444 742.4 489.244444 748.8 521.244444 748.8L521.244444 748.8 521.244444 748.8 521.244444 748.8z" p-id="3507"></path></svg>`,
            width: 20,
            height: 20,
            // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
            name: 'setting', //定义图标的名称，在内部会作为缓存的key值
            positionType: VTable.TYPES.IconPosition.right, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
            marginLeft: 0, // 左侧内容间隔 在特定位置position中起作用
            marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
            hover: {
              // 热区大小
              width: 22,
              height: 22,
              bgColor: 'rgba(22,44,66,0.2)'
            },
            tooltip: {
              style: { arrowMark: true },
              placement: VTable.TYPES.Placement.top,
              // 气泡框，按钮的的解释信息
              title: '对象定义形式 非注册'
            }
          }
        ],
        icon: [
          'more',
          'phone',
          'book',
          {
            type: 'svg', //指定svg格式图标，其他还支持path，image，font
            svg: `<svg t="1669305300496" class="icon" viewBox="0 0 1034 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3506" width="200" height="200"><path d="M1033.244444 652.8c0 6.4 0 19.2 0 32s-6.4 25.6-12.8 38.4c-6.4 12.8-12.8 25.6-19.2 32-6.4 12.8-12.8 19.2-25.6 19.2-6.4 6.4-19.2 6.4-25.6 6.4-6.4 0-12.8 0-19.2-6.4-6.4 0-19.2-6.4-25.6-6.4-12.8 0-19.2 0-32 0s-25.6 6.4-32 6.4c-12.8 6.4-19.2 12.8-32 19.2-19.2 19.2-25.6 38.4-32 64 0 25.6 0 44.8 12.8 64 6.4 12.8 6.4 32-6.4 44.8-6.4 6.4-12.8 12.8-19.2 19.2-6.4 6.4-19.2 12.8-32 19.2-12.8 6.4-25.6 6.4-38.4 12.8-12.8 0-25.6 6.4-32 6.4-6.4 0-12.8 0-19.2-6.4-6.4-6.4-12.8-12.8-12.8-19.2l0 0c-6.4-25.6-19.2-44.8-38.4-57.6-19.2-19.2-44.8-25.6-70.4-25.6S476.444444 921.6 450.844444 940.8c-19.2 19.2-32 38.4-44.8 57.6-6.4 6.4-6.4 12.8-19.2 19.2C386.844444 1024 380.444444 1024 367.644444 1024c-12.8 0-19.2 0-32-6.4-12.8-6.4-25.6-6.4-38.4-12.8-12.8-6.4-25.6-12.8-32-19.2-12.8-6.4-19.2-12.8-25.6-19.2-6.4-6.4-6.4-12.8-6.4-19.2 0-6.4 0-19.2 6.4-32 6.4-19.2 12.8-38.4 6.4-57.6 0-19.2-12.8-44.8-25.6-57.6S194.844444 780.8 182.044444 780.8c-12.8-6.4-25.6-6.4-44.8-6.4-12.8 0-32 6.4-44.8 6.4s-19.2 0-32 0c-6.4 0-12.8-12.8-25.6-19.2-6.4-12.8-12.8-25.6-19.2-38.4C9.244444 710.4 2.844444 697.6 2.844444 684.8s-6.4-25.6 0-32c0-19.2 6.4-25.6 19.2-32C54.044444 614.4 73.244444 595.2 92.444444 576s25.6-44.8 25.6-64c0-25.6-6.4-51.2-25.6-64C73.244444 422.4 54.044444 409.6 34.844444 403.2 28.444444 396.8 22.044444 390.4 15.644444 384 9.244444 377.6 9.244444 364.8 9.244444 358.4c0-6.4 0-19.2 6.4-32 0-12.8 6.4-25.6 12.8-32 6.4-12.8 12.8-19.2 19.2-32 0-6.4 6.4-12.8 12.8-19.2C66.844444 236.8 73.244444 236.8 79.644444 236.8c6.4 0 12.8 0 19.2 6.4 19.2 6.4 44.8 12.8 64 6.4 25.6-6.4 44.8-12.8 64-32 6.4-6.4 12.8-19.2 19.2-32 6.4-12.8 6.4-25.6 6.4-38.4s0-25.6 0-32c0-12.8 0-19.2 0-19.2 0-6.4 0-6.4-6.4-12.8 0-6.4 0-12.8 0-12.8 6.4-19.2 19.2-25.6 25.6-38.4 12.8-6.4 25.6-12.8 38.4-19.2C322.844444 6.4 335.644444 6.4 348.444444 0c12.8 0 25.6 0 32 0C386.844444 0 393.244444 0 399.644444 6.4c6.4 6.4 6.4 12.8 12.8 19.2C418.844444 51.2 431.644444 64 450.844444 83.2c19.2 12.8 38.4 25.6 64 25.6 25.6 0 51.2-6.4 70.4-19.2 19.2-12.8 32-32 44.8-57.6 0-6.4 6.4-12.8 12.8-19.2C649.244444 0 655.644444 0 662.044444 0c12.8 0 19.2 0 32 6.4 12.8 0 25.6 6.4 38.4 12.8 12.8 6.4 25.6 12.8 32 19.2C770.844444 44.8 777.244444 51.2 783.644444 64c6.4 6.4 6.4 12.8 6.4 19.2 0 6.4 0 12.8-6.4 12.8-6.4 19.2-12.8 44.8-6.4 64 6.4 25.6 12.8 44.8 32 64s38.4 25.6 64 32c25.6 0 51.2 0 70.4-12.8 6.4-6.4 12.8-6.4 19.2-6.4 6.4 0 12.8 6.4 19.2 12.8 12.8 12.8 19.2 25.6 32 44.8 6.4 19.2 12.8 44.8 19.2 64 0 12.8 0 19.2-6.4 32-6.4 6.4-12.8 12.8-19.2 12.8C982.044444 409.6 962.844444 422.4 950.044444 448c-19.2 19.2-25.6 44.8-25.6 70.4 0 25.6 6.4 44.8 19.2 64 12.8 19.2 32 32 51.2 38.4 6.4 0 6.4 6.4 12.8 6.4C1020.444444 633.6 1026.844444 640 1033.244444 652.8L1033.244444 652.8 1033.244444 652.8 1033.244444 652.8zM521.244444 748.8c32 0 64-6.4 96-19.2 32-12.8 57.6-32 76.8-51.2 19.2-19.2 38.4-44.8 51.2-76.8C751.644444 576 758.044444 544 758.044444 512s-6.4-64-19.2-96C726.044444 384 706.844444 364.8 687.644444 339.2 668.444444 320 642.844444 300.8 610.844444 288 585.244444 275.2 553.244444 268.8 521.244444 268.8s-64 6.4-96 19.2C399.644444 300.8 374.044444 320 348.444444 339.2 329.244444 364.8 310.044444 390.4 297.244444 416 290.844444 448 284.444444 480 284.444444 512s6.4 64 19.2 96c12.8 32 32 57.6 51.2 76.8 19.2 19.2 44.8 38.4 76.8 51.2C457.244444 742.4 489.244444 748.8 521.244444 748.8L521.244444 748.8 521.244444 748.8 521.244444 748.8z" p-id="3507"></path></svg>`,
            width: 20,
            height: 20,
            // funcType: VTable.TYPES.IconFuncTypeEnum.sort,//对应内部特定功能的图标，目前有sort frozen expand等
            name: 'setting', //定义图标的名称，在内部会作为缓存的key值
            positionType: VTable.TYPES.IconPosition.right, // 指定位置，可以在文本的前后，或者在绝对定位在单元格的左侧右侧
            marginLeft: 0, // 左侧内容间隔 在特定位置position中起作用
            marginRight: 0, // 右侧内容间隔 在特定位置position中起作用
            hover: {
              // 热区大小
              width: 22,
              height: 22,
              bgColor: 'rgba(22,44,66,0.2)'
            },
            tooltip: {
              style: { arrowMark: true },
              placement: VTable.TYPES.Placement.top,
              // 气泡框，按钮的的解释信息
              title: '对象定义形式 非注册'
            }
          }
        ],
        style: {
          autoWrapText: true
        },
        headerStyle: {
          autoWrapText: true
        }
      },
      {
        field: 'id',
        title: 'ID编号',
        sort: (v1, v2, order) => {
          if (order === 'desc') {
            return v1 === v2 ? 0 : v1 > v2 ? -1 : 1;
          }
          return v1 === v2 ? 0 : v1 > v2 ? 1 : -1;
        },
        width: 100,
        icon: [
          'filter'
          // {
          //   type: 'font',
          //   name: 'icon-define',
          //   //定义文本内容行内图标，第一个字符展示
          //   font: 'normal normal normal 14px/1 FontAwesome',
          //   content: '\uf15b',
          //   width: 16, // Optional
          //   height: 96,
          //   color: 'black',
          //   hover: {
          //     // 热区大小
          //     width: 26,
          //     height: 26,
          //     bgColor: 'rgba(22,44,66,0.5)'
          //   },
          //   positionType: VTable.TYPES.IconPosition.inlineFront
          // }
        ]
      },
      {
        field: 'id',
        fieldFormat(rec) {
          return `这是第${rec.id}号`;
        },
        title: 'ID说明',
        description: '这是一个ID详细描述',
        sort: (v1, v2, order) => {
          if (order === 'desc') {
            return v1 === v2 ? 0 : v1 > v2 ? -1 : 1;
          }
          return v1 === v2 ? 0 : v1 > v2 ? 1 : -1;
        },
        width: 150
      },
      {
        title: 'Name',
        headerStyle: {
          textAlign: 'center',
          fontWeight: 'bold',
          fontSize: 13,
          fontFamily: 'sans-serif'
        },
        field: 'name',
        width: 150
      }
    ],
    showFrozenIcon: true, //显示VTable内置冻结列图标
    widthMode: 'standard',
    frozenColCount: 0, //冻结列
    allowFrozenColCount: 8,
    records: personsDataSource,
    tooltip: {
      renderMode: 'html',
      isShowOverflowTextTooltip: false
    },
    heightMode: 'autoHeight'
  };

  const listTable = new VTable.ListTable(containerDom, option);
  test('listTable-icon getCellOverflowText', () => {
    const moreIcon = listTable.scenegraph.getCell(0, 2).children[2];
    expect(moreIcon.name).toBe('more');
    const moreAABBBounds = listTable.scenegraph.getCell(0, 2).children[2].AABBBounds;
    expect(moreAABBBounds.x1).toBe(98);
    expect(moreAABBBounds.y1).toBe(27);
    expect(moreAABBBounds.x2).toBe(114);
    expect(moreAABBBounds.y2).toBe(43);
    listTable.release();
  });
});
